
#include <platSysTimeMs.h>

#if DEVICE_PLATFORM_CONFIGURE == DEVICE_PLATFORM_LINUX
#include <time.h>
#include <sys/time.h>
sysTimeTypeMs systemNowMs()
{
    struct timespec tnow;
    clock_gettime(CLOCK_MONOTONIC, &tnow);
    return (sysTimeTypeMs)(tnow.tv_sec) * 1000 + tnow.tv_nsec / 1000000;
}
#else
static sysTimeTypeMs systemMsCount = 0;
    // ===coding by user self=== add into timer
void systemMsAdd(uint8_t addMs)
{
    systemMsCount += addMs;
}
sysTimeTypeMs systemNowMs()
{
    return systemMsCount;
}
#endif

